/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package TimeRecording.TimeClockServer.dtos;

import TimeRecording.TimeClockServer.messages.ClockMessage;
import java.util.Formatter;

/**
 *
 * @author david
 */
public class BadgeDetails {

    private final static String DOWNLOAD_COMMAND =
            "[HDR]LEC01%1$012d%2$-20s[RS]";

    private int badgeNo;
    private int employeeId;
    private String employeeName;

    public BadgeDetails(int badgeNo, int employeeId, String employeeName) {
        this.badgeNo = badgeNo;
        this.employeeId = employeeId;
        this.employeeName = employeeName;
    }

    public int getBadgeNo() {
        return badgeNo;
    }

    public void setBadgeNo(int badgeNo) {
        this.badgeNo = badgeNo;
    }

    public int getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(int employeeId) {
        this.employeeId = employeeId;
    }

    public String getEmployeeName() {
        return employeeName;
    }

    public void setEmployeeName(String employeeName) {
        this.employeeName = employeeName;
    }

    public ClockMessage getInitialisationData() {
        Formatter downloadCommand = new Formatter();
        downloadCommand.format(DOWNLOAD_COMMAND, badgeNo, employeeName);
        return new ClockMessage(downloadCommand.toString());
    }
}
